package abstractfactory.factory;

import abstractfactory.interf.Color;
import abstractfactory.interf.Shape;
import abstractfactory.impl.Circle;
import abstractfactory.impl.Square;

/**
 * @ClassName ShapeFactory
 * @Description TODO
 * @Author 马继斌
 * @Email 1423553596@qq.com
 * @Date 18-8-29 上午5:42
 **/
public class ShapeFactory extends AbstractFactory {
    /**
     * 返回Color对象
     *
     * @param color 颜色类型
     * @return
     */
    @Override
    public Color getColor(String color) {
        return null;
    }

    /**
     * 返回Shape对象
     *
     * @param shape 形状类型
     * @return
     */
    @Override
    public Shape getShape(String shape) {
        if(shape == null){
            return null;
        }
        if(shape.equalsIgnoreCase("CIRCLE")){
            return new Circle();
        }
        else if(shape.equalsIgnoreCase("SQUARE")){
            return new Square();
        }
        return null;
    }
}
